﻿<navigation:Page x:Class="ITSSP.Views.GuestUserListPage"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
           xmlns:dataForm="clr-namespace:ITSSP.Controls"
           xmlns:itsspWebServices="clr-namespace:ITSSP.Web.Services"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Guest users">
    
    <Grid x:Name="LayoutRoot">
        <ScrollViewer BorderThickness="0" VerticalScrollBarVisibility="Auto">
            <StackPanel Orientation="Vertical">
                <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" Text="{Binding Path=ApplicationStrings.GuestUserListTitle, Source={StaticResource ResourceWrapper}}"/>
        
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button x:Name="addNewUser" Width="100" Height="23"  Content="New Guest User"  Margin="4,0,0,0" Click="addNewUser_Click"/>
                    <Button x:Name="delCurUser" Width="110" Height="23"  Content="Delete Guest User"  Margin="4,0,0,0" Click="delCurUser_Click"/>
                </StackPanel>
        
                <data:DataGrid x:Name="userGrid" IsReadOnly="True" MinHeight="200" ItemsSource="{Binding Data, ElementName=GuestDataSource}" AutoGenerateColumns="False" Margin="0,12,0,0">
                    <data:DataGrid.Columns>
                        <data:DataGridTextColumn Header="ID" Binding="{Binding Id}" />
                        <data:DataGridTextColumn Header="First Name" Binding="{Binding FirstName}" />
                        <data:DataGridTextColumn Header="Last Name" Binding="{Binding LastName}" />
                        <data:DataGridTextColumn Header="E-Mail" Binding="{Binding EMailAddress}" />
                        <data:DataGridCheckBoxColumn Header="Enabled" Binding="{Binding Enabled}" />
                        <data:DataGridTemplateColumn Header="Commands" IsReadOnly="True">
                            <data:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                        <Button x:Name="editCurUser" Height="24" Click="editCurUser_Click"><Image Source="../Assets/126_Edit_48x48_72.png"/></Button>
                                        <Button x:Name="pwdCurUser" Height="24" Click="pwdCurUser_Click"><Image Source="../Assets/157_GetPermission_48x48_72.png"/></Button>
                                    </StackPanel>
                                </DataTemplate>
                            </data:DataGridTemplateColumn.CellTemplate>
                        </data:DataGridTemplateColumn>
                    </data:DataGrid.Columns>
                </data:DataGrid>
                <data:DataPager PageSize="20" Source="{Binding Data, ElementName=GuestDataSource}" Margin="0,-1,0,0" />
            </StackPanel>
        </ScrollViewer>
    </Grid>
</navigation:Page>